package com.bxait.toymail.cart.config;

import com.bxait.toymail.cart.interceptor.CartInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/*
@description: 视图跳转
@ClassName ToyMailWebConfig
@author Chen
@create 2023-04-20 17:29
@Version 1.0
*/
@Configuration
public class ToyMailWebConfig implements WebMvcConfigurer {

    /**
     * @param registry
     * @==============History===============<br/>
     * @Description // 在容易中放一个拦截器,拦截索引索引请求
     * @Date 2023/4/22 13:45
     * @Author <a href="qq:2277411582@qq.com">chen</a>
     * @return void
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new CartInterceptor()).addPathPatterns("/**");
    }
}
